CFLAGS=-Wall -pedantic -Wextra#-Werror
CXX=g++
TINYDIR=tinyxml/

# $@ is the name of the file to be made

carchallenge: main.o world.o \
tinyxml.o tinyxmlparser.o tinyxmlerror.o tinystr.o \
menumanager.o menuscreen.o tire.o car.o
	$(CXX) $(CFLAGS) -o $@ $^ -lglut -lGL
	./carchallenge

tinyxml.o: $(TINYDIR)tinyxml.cpp
	$(CXX) $(CFLAGS) -c $(TINYDIR)tinyxml.cpp -o $@

tinyxmlparser.o: $(TINYDIR)tinyxmlparser.cpp
	$(CXX) $(CFLAGS) -c $(TINYDIR)tinyxmlparser.cpp -o $@

tinyxmlerror.o: $(TINYDIR)tinyxmlerror.cpp
	$(CXX) $(CFLAGS) -c $(TINYDIR)tinyxmlerror.cpp -o $@

tinystr.o: $(TINYDIR)tinystr.cpp
	$(CXX) $(CFLAGS) -c $(TINYDIR)tinystr.cpp -o $@

main.o: main.cpp main.h
	$(CXX) $(CFLAGS) -c main.cpp -o $@

world.o: world.cpp world.h
	$(CXX) $(CFLAGS) -c world.cpp -o $@

menumanager.o: menumanager.cpp menumanager.h
	$(CXX) $(CFLAGS) -c menumanager.cpp -o $@

menuscreen.o: menuscreen.cpp menuscreen.h
	$(CXX) $(CFLAGS) -c menuscreen.cpp -o $@

tire.o: tire.cpp tire.h
	$(CXX) $(CFLAGS) -c tire.cpp -o $@

car.o: car.cpp car.h
	$(CXX) $(CFLAGS) -c car.cpp -o $@

clean:
	rm main.o world.o tinyxml.o tinyxmlparser.o tinyxmlerror.o tinystr.o menumanager.o menuscreen.o carchallenge
